Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Feb 2001 00:16:14 -0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Lars Eggert <larse@ISI.EDU>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: capturing an early kernel dump 
Message-ID:  <200102020816.f128GEW23386@mobile.wemm.org>
In-Reply-To: <B69FA5AA.A79C%larse@isi.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
Lars Eggert wrote:
> > Lars Eggert wrote:
> >> How do I capture an early kernel dump (before rc executes and sets
> >> dumpdev)?
> > 
> > How early?  We could dump if you were prepared to hardwire in the minor and
> > major device numbers to get to the devsw[] vectors and manually set the
> > offsets.
> 
> Not that early :-)
> 
> I'm playing with the networking code; by that time, the disks should have
> been probed.

Hmm.. driver or stack?  If it is a driver, then why not just kldload it?
Anyway, just a thought.  gdb can still debug it, but you need to do a little
magic to pick up the file and symbols - an example of which is in
src/sys/modules/vinum/.gdb*.

> Is there an "easy way" to configure a dump device after the disks are up?

If you do a boot -v, you should see something like:  'creating disk ad0'
and/or 'wd0' on RELENG_4 boxes, that is after interrupts are enabled and
the minidisk layer can get to the disk partition info.  It is probably too
late for network stack stuff by then though as the stacks are initialized
earlier.  See sys/kernel.h for the SYSINIT ordering.

Have a look at kern/kern_shutdown.c, setdumpdev().  Note the call to
devsw->d_psize() - that gets the number of blocks in the partition.
If you boot to multi-user you might be able to get these magic values
and hardwire the bootstrap to set these values and dumpdev.

However... there is a BIG difference between RELENG_4 and -current in this
area right how.  In RELENG_4, dev_t (and hence dumpdev) is a simple integer
for the minor/major number.  In -current, dev_t is a pointer to a struct.
You probably have a pretty good chance at hotwiring dumps early in RELENG_4
but will need to do major surgery in -current to do the same.  I am not
sure if I'd want to recommend that, but I could give pointers if you're
desperate.

Seriously though, please thoroughly check out the KLD module option and see
if you can get that to work somehow.

> Thanks,
> Lars
> -- 
> Lars Eggert <larse@isi.edu>                   Information Sciences Institute
> http://www.isi.edu/larse/                  University of Southern California
> 
> 

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102020816.f128GEW23386>